<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<div class="section">
    <table width="100%" align="center" class="cart-table" border="0" cellspacing="0" cellpadding="8">
        <tbody>
        <tr>
            <th align="left" colspan="2">商品信息</th>
            <th width="84" align="left">单价</th>
            <th width="104" align="center">数量</th>
            <th width="104" align="left">金额(元)</th>
            <th width="54" align="center">操作</th>
        </tr>
 		<c:forEach items="${cartList}" var="bean">
        <tr>
            <td width="68">
                <a target="_blank" href="${pathUrl}home/goods?action=detail&id=${bean.id}">
                    <img  onerror="this.src='${pathUrl }/public/images/nopic.png'" src="${pathUrl}${bean.goods.goodsImg}" class="img">
                </a>
            </td>
            <td>
                <a target="_blank" href="${pathUrl}home/goods?action=detail&id=${bean.id}${bean.goods.goodsName}">${bean.goods.goodsName}</a>
                <p class="stxt"></p>
            </td>
            <td>
                	￥${bean.goods.sellPrice}
            </td>
            <td align="center">
                <div class="buy-box">
                 ${bean.goNum}
                </div>
            </td>
            <td>
                <span class="red">
                    ￥<label name="amountCount">${bean.goods.sellPrice*bean.goNum}</label>
                </span>
            </td>
            <td align="center">
                <a  href="javascript:;" onclick="deleteOne(${bean.id})">删除</a>
            </td>
        </tr>

         </c:forEach>
       <tr>
            <th align="right" colspan="6">
          	           已选择商品 <b class="red" id="totalQuantity">${goNum }</b> 件 &nbsp;&nbsp;&nbsp;
             	   商品总金额（不含运费）：<span class="red">￥0</span><b class="red" id="totalAmount">${totalMoney }</b>元
            </th>
        </tr>
         <c:if test="${empty cartList}">
         <tr>
          <td colspan="6">暂无商品</td>
         </tr>
         </c:if>
        </tbody>
    </table>
</div>
 <c:if test="${!empty cartList}">
<div class="cart-foot section">
    <div class="right-box">
        <button class="button" type="button" onclick="javascript:location.href='${pathUrl}/home/goods/index';">继续购物</button>
        <button class="button" style="background:#34ad2a" onclick="sumbitWirter()">立即结算</button>
    </div>
</div>
</c:if>
